package com.liruo.srpingframework.dataaccess.transaction;

import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Slf4j
@Service
public class TransactionService{
  @Resource
  TransactionEntityRepository repository;
  @Transactional
  public void publicMethod() {
    repository.save(new TransactionEntity(null ,"publicMethod"));
    throw new RuntimeException("publicMethod");
  }

}
